Bug 555779 – GtkCellRendererPixbuf crashed on failed GIcon lookup
authorMatthias Clasen <mclasen@redhat.com>
Tue, 14 Oct 2008 03:47:18 +0000 (03:47 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 14 Oct 2008 03:47:18 +0000 (03:47 +0000)
2008-10-13  Matthias Clasen  <mclasen@redhat.com>

        Bug 555779 – GtkCellRendererPixbuf crashed on failed GIcon lookup

        * gtk/gtkcellrendererpixbuf
        (gtk_cell_renderer_pixbuf_create_themed_pixbuf): Don't crash
        if a GIcon is not present in the current theme. Patch by
        Alex Larsson.

svn path=/trunk/; revision=21650

ChangeLog
gtk/gtkcellrendererpixbuf.c

index a79607499bb71b78dcf4b21d2be20f025de07a13..c57b41b3a94d59a20ba54c87170360825d94e5a2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-10-13  Matthias Clasen  <mclasen@redhat.com>
+
+       Bug 555779 – GtkCellRendererPixbuf crashed on failed GIcon lookup
+
+       * gtk/gtkcellrendererpixbuf
+       (gtk_cell_renderer_pixbuf_create_themed_pixbuf): Don't crash
+       if a GIcon is not present in the current theme. Patch by 
+       Alex Larsson.
+
 2008-10-13  Matthias Clasen  <mclasen@redhat.com>
 
        Bug 552318 – menubar mnemonics consumed even when
index 87a73d673e682d18894119a504550d2fee6ff009..a75a88f0585e39e808735854b3bd5386fc48de48 100644 (file)
@@ -454,8 +454,16 @@ gtk_cell_renderer_pixbuf_create_themed_pixbuf (GtkCellRendererPixbuf *cellpixbuf
                                              priv->gicon,
                                             MIN (width, height), 
                                              GTK_ICON_LOOKUP_USE_BUILTIN);
-      cellpixbuf->pixbuf = gtk_icon_info_load_icon (info, &error);
-      gtk_icon_info_free (info);
+      if (!info)
+        {
+          g_set_error (&error, GTK_ICON_THEME_ERROR,  GTK_ICON_THEME_NOT_FOUND,
+                       _("Icon not present in theme"));
+        }
+      else
+        {
+          cellpixbuf->pixbuf = gtk_icon_info_load_icon (info, &error);
+          gtk_icon_info_free (info);
+        }
     }
 
   if (!cellpixbuf->pixbuf)